home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Languages Suite
/
ProgLangD.iso
/
TURBOPASCAL WIN
/
OWLDEMOS.PAK
/
EDITAPP.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-06-08
|
2KB
|
58 lines
{************************************************}
{ }
{ Turbo Pascal for Windows }
{ Demo program }
{ Copyright (c) 1991 by Borland International }
{ }
{************************************************}
program TextEditor;
uses WObjects, WinTypes, WinProcs, StdWnds;
type
{ Declare TEditApp, a TApplication descendant }
TEditApp = object(TApplication)
procedure InitMainWindow; virtual;
procedure InitInstance; virtual;
end;
{ Declare TMyEditWindow, a TEditWindow descendant }
PMyEditWindow = ^TMyEditWindow;
TMyEditWindow = object(TEditWindow)
constructor Init(AParent: PWindowsObject; ATitle: PChar);
end;
{ Construct a TMyEditWindow, loading its menu }
constructor TMyEditWindow.Init(AParent: PWindowsObject; ATitle: PChar);
begin
TEditWindow.Init(AParent, ATitle);
Attr.Menu := LoadMenu(HInstance, 'EditCommands');
end;
{ Construct the TEditApp's MainWindow of type TMyEditWindow }
procedure TEditApp.InitMainWindow;
begin
MainWindow := New(PMyEditWindow, Init(nil, 'EditWindow'));
end;
{ Initialize each MS-Windows application instance, loading an
accelerator table }
procedure TEditApp.InitInstance;
begin
TApplication.InitInstance;
HAccTable := LoadAccelerators(HInstance, 'EditCommands');
end;
{ Declare a variable of type TEditApp }
var
EditApp : TEditApp;
{ Run the EditApp }
begin
EditApp.Init('EditApp');
EditApp.Run;
EditApp.Done;
end.